import request from "./request";

export class FileApi {
  static upload(file): Promise<IFile> {
    const formData = new FormData();
    formData.append("file", file);
    return request.post("/file/upload", formData, {
      headers: {
        "Content-Type": "multipart/formdata"
      }
    });
  }
  static getFiles(params) {
    return request.get("/file", { params });
  }
  static deleteFile(id) {
    return request.delete(`/file/${id}`);
  }
}
